package org.dromara.common.translation.core.impl;

import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.translation.annotation.TranslationType;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.common.translation.core.TranslationInterface;
import org.dromara.system.api.services.SystemUserApiService;
import org.springframework.util.Assert;

/**
 * 用户名翻译实现
 *
 * @author shuai.zhou
 */
@RequiredArgsConstructor
@TranslationType(type = TransConstant.USER_ID_TO_NAME)
public class UserNameTranslationImpl implements TranslationInterface<String> {

    private final SystemUserApiService systemUserApiService;

    @Override
    public String translation(Object key, String other) {
        return systemUserApiService.selectUserNameById((Long) key);
    }

}
